package sq.repository;


import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import sq.dao.VerificationInfo;

import javax.transaction.Transactional;


/**
 * 短信JPA仓库
 * @author sunquan
 */
@Repository
@Transactional
public interface VerificationRepository extends JpaRepository<VerificationInfo, Long> {
    /**
     * 根据手机号查询验证码数据库中的内容
     *
     * @param phone 开发者手机号
     * @return VerificationInfo 短信实体类
     */
    VerificationInfo findVerificationInfoByPhone(String phone);

    /**
     * 根据手机号删除数据库里面关于此手机号的验证码内容
     * @param phone 用户手机号码
     */
    void deleteByPhone(String phone);
}
